import request from '@/utils/request'
//查询所有科室
export function listAllDept() {
  return request({
    url:   '/sysmanage/dept/all',
    method:   'get'
  });
}
//查询所有级别。。背景
export function listAlllevel() {
  return request({
    url:   '/sysmanage/user/all',
    method:   'get'
  });
}

// 查询用户列表
export function listSysUser(query) {
  return request({
    url: '/sysmanage/user/find',
    method: 'get',
    params: query
  })
}

// 查询部门列表（排除节点）
export function listDeptExcludeChild(deptId) {
  return request({
    url: '/system/dept/list/exclude/' + deptId,
    method: 'get'
  })
}

// 查询部门详细
export function getUserOne(userId) {
  return request({
    url: '/sysmanage/user/' + userId,
    method: 'get'

  })
}

// 查询部门下拉树结构
export function treeselect() {
  return request({
    url: '/system/dept/treeselect',
    method: 'get'
  })
}

// 根据角色ID查询部门树结构
export function roleDeptTreeselect(roleId) {
  return request({
    url: '/system/dept/roleDeptTreeselect/' + roleId,
    method: 'get'
  })
}

// 新增科室
export function addUser(data) {
  return request({
    url: '/sysmanage/user',
    method: 'post',
    data: data
  })
}

// 修改部门
export function updateUsers(data) {
  return request({
    url: '/sysmanage/user',
    method: 'put',
    data: data
  })
}

// 删除部门
export function delUsers(userId) {
  return request({
    url: '/sysmanage/user/' + userId,
    method: 'delete'
  })
}
